﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AppCommerciaux.Entity;

namespace AppCommerciaux.ViewModels
{
    public class ClientViewModel : ViewModelBase
    {
        public ClientViewModel(ViewModelBase model)
        {
            this.Model = model;
        }

        public ClientViewModel()
        {
            using (Entity.liv3Entities1 dc = new Entity.liv3Entities1())
            {
                var querySelect = from tiers_societe in dc.tiers_societe
                                  select tiers_societe;

                allClients = querySelect.ToList();

            }
            allClients.Add(new tiers_societe());
            //Titre = "Commande";            
        }

        private List<tiers_societe> _allClients;
        public List<tiers_societe> allClients
        {
            get { return _allClients; }
            set
            {
                if (_allClients != value)
                {
                    _allClients = value;
                    OnPropertyChanged("allClients");
                }
            }
        }

        public ViewModelBase Model { get; private set; }
    }
}
